package com.sise.wangzhan.client;

import feign.Headers;
import feign.Param;
import feign.RequestLine;
import lombok.Data;

/**
 * @Classname PersonClient
 * @Description TODO
 * @Date 2020/4/8 21:15
 * @Created by wangzhan
 */
public interface PersonClient {

    @RequestLine("GET /person/{person_id}")
    Person findById(@Param("person_id") Integer person_id);

    @RequestLine("POST /person/create")
    //声明请求类型为JSON
    @Headers("Content-Type: application/json")
    String createPerson(Person person);

    @Data
    class Person {
        private Integer person_id;
        private String p_name;
        private int age;
        private String message;
    }
}
